package jangdolbaeng2.db;

/* DB자료를 다른 DB로 옮기기 위한 프로그램*/
public class DBTransfer {
	// db TABLE 이전 순서 seller shop customer product cart order order-detail qa qacomment
	
	// seller table
	public void sellerTransfer(){
		TransferDAO dao = new TransferDAO();
		dao.insertSeller(dao.selectSeller());
	}

	// shop table
	public void shopTransfer(){
		TransferDAO dao = new TransferDAO();
		dao.insertShop(dao.selectShop());
	}	
	// customer table
	public void customerTransfer(){
		TransferDAO dao = new TransferDAO();
		dao.insertCustomer(dao.selectCustomer());
	}

	
	// product table
	public void productTransfer(){
		TransferDAO dao = new TransferDAO();
		dao.insertProduct(dao.selectProduct());
	}

	
	// cart table
	public void cartTransfer(){
		TransferDAO dao = new TransferDAO();
		dao.insertCart(dao.selectCart());
	}

	
	// order table
	public void orderTransfer(){
		TransferDAO dao = new TransferDAO();
		dao.insertOrder(dao.selectOrder());
	}

	
	// order_detail table
	public void orderDetailTransfer(){
		TransferDAO dao = new TransferDAO();
		dao.insertOrderDetail(dao.selectOrderDetail());
	}

	// delivery table
	public void deliveryTransfer(){
		TransferDAO dao = new TransferDAO();
		dao.insertDelivery(dao.selectDelivery());
	}
	
	// shop_qa table
	public void shopQATransfer(){
		TransferDAO dao = new TransferDAO();
		dao.insertShopQA(dao.selectShopQA());
	}

	
	// qa_comment table
	public void QACommentTransfer(){
		TransferDAO dao = new TransferDAO();
		dao.insertQaComment(dao.selectQaComment());
	}

	public void transfer(){
		sellerTransfer();
		shopTransfer();
		customerTransfer();
		productTransfer();
		cartTransfer();
		orderTransfer();
		orderDetailTransfer();
		deliveryTransfer();
		shopQATransfer();		
		QACommentTransfer();
	}
}
